// 统一管理项目用户相关接口
import request from '@/utils/request'
import { userInfoResponseData, loginFormData, loginResponseData } from './type'
//  项目用户相关的请求地址

enum API {
  // LOGIN_URL = '/admin/acl/index/login',
  LOGIN_URL = '/admin/user/login',
  USERINFO_URL = '/admin/user/info',
  EDITPASSWORD_URL = '/admin/user/editPassword',
  LOGOUT_URL = '/admin/user/logout',
}

// 登录接口
export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)

// 获取用户信息
export const reqUserInfo = () =>
  request.get<any, userInfoResponseData>(API.USERINFO_URL)

// 修改密码
export const reqEditPassword = (data: any) =>
  request.post<any, any>(API.EDITPASSWORD_URL, data)

// 退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
